<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    /**
     * 很简单的一道原型链的题，只涉及基础概念，想必小友早已烂熟于心，这里就直接过了
     */
    const alterObjects = (obj, greeting) => (obj.prototype.greeting = greeting);

    var C = function (name) {
      this.name = name;
      return this;
    };
    var obj1 = new C("Rebecca");
    alterObjects(C, "What's up");
    console.log(obj1.greeting);
  </script>
</html>
